package com.doit.demo04;

import java.io.Serializable;
/*
Serializable标记接口,实现接口就行
static修饰的成员不能序列化 静态关键字
transient修饰的成员也不能序列化 瞬态关键字
 */

public class Person implements Serializable{
    private static final long serialVersionUID = -138;//反序列化使用
    private String name;
    private int age;

    @Override
    public String toString() {
        return name+" "+age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Person() {

    }

    public Person(String name, int age) {

        this.name = name;
        this.age = age;
    }
}
